const path = require('path');

// 开发环境调试地址
const targetUrl = 'http://139.198.15.29:40103'; // 后端接口地址
const baseUrl = "http://139.198.15.29";
const wsUrl = 'ws://139.198.15.29:40103';
const loginUrl = 'http://139.198.15.29:40102'

module.exports = {
    entry: './app.js', // 必须有入口文件
    mode: 'development',
    resolve: {
        extensions: ['.js', '.json', '.wasm'],
    },
    devServer: {
        static: {
            directory: path.join(__dirname, './www'), // 静态本地服务
        },
        host: '0.0.0.0',
        port: 9000,
        hot: true,
        open: true,
        proxy: {
            '/bmsApi': {
                target: targetUrl,
                changeOrigin: true,
                 // pathRewrite: { '^/bmsApi': '' },
            },
            '/bms/': {
                target: targetUrl,
                changeOrigin: true,
            },
            '/registerApi': {
                target: targetUrl,
                changeOrigin: true,
            },
            '/resolverApi': {
                target: targetUrl,
                changeOrigin: true,
            },
            '/api/blade-DWHMonitor': {
                target: targetUrl,
                changeOrigin: true,
            },
            '/ws/': {
                target: wsUrl,
                ws: true,
                changeOrigin: true,
            },
            '/user-manager/userApi': {
                target: targetUrl,
                changeOrigin: true,
            },
            '/GT_API/blade-DWHCMS/api':{
                target: targetUrl,
                changeOrigin: true,
            },
            '/user-center-oauth': {
                target: loginUrl,
                changeOrigin: true,
            },
            '/api/blade-system/':{
                target: targetUrl,
                changeOrigin: true,
            },
            '/api/blade-user/':{
                target: targetUrl,
                changeOrigin: true,
            }
        },
    },
};

